package StudyCode.summary.myfile;

import java.nio.ByteBuffer;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReadArray31 {
	public static byte[] readArray31(ByteBuffer buf) {
		int length = getUnsigned31(buf);
		byte[] array = new byte[length];
		buf.get(array);
		return array;
	}

	private static int getUnsigned31(ByteBuffer buf) {
		return buf.getInt() & 0x7fffffff;
	}
}
